//
//  JLCLRewardedVideoViewController.m
//  JLCLTestDemo
//
//  Created by Eren on 2022/3/29.
//

#import "JLCLRewardedVideoViewController.h"

@interface JLCLRewardedVideoViewController () <JLCLRewardVideoAdDelegate>

@end

@implementation JLCLRewardedVideoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self show];
    UIButton *btn = [self createBtnWithTitle:@"激励视频广告" withToTop:kNavBarAndStatusBarHeight +20 wihtHeight:40 withSelect:@selector(show)];
    [self.view addSubview:btn];
}
- (void)show {
    JLCLRewardVideoAdData *data = [[JLCLRewardVideoAdData alloc] init];
    data.delegate = self;
    data.ad_id = kJLCLTestRewardeVideoAdID;// 广告位ID   必传
    data.userId = @"1234";//如果需要开启服务器回调 请输入userId、extra(选填)
    data.extra = @{};//当选择需要服务端验证时，开发者需要按照文档中要求进行接口开发，并在平台上填写回调
    data.location = 1;// 位置标识符 多个同类型广告时请准确填写位置标识 默认为1
    data.rootViewController = self;
    self.aCenter = [[JLCLAdManagementCenter alloc] init];
    [self.aCenter jlcl_showRewardVideoAd:data];
}

- (void)jlcl_rewardVerify {
    NSLog(@"触发奖励");
}

- (void)jlcl_rewardAdClose {
    NSLog(@"广告关闭");
}

- (void)jlcl_rewardAdClicked {
    NSLog(@"广告被点击");
}

- (void)jlcl_rewardAdFail:(NSString *)error {
    NSLog(@"广告报错了 = %@",error);
}

- (void)jlcl_rewardAdExposure {
    NSLog(@"广告曝光");
}

- (void)jlcl_rewardVideoCached {
    NSLog(@"广告加载完成此时不卡");
    [self.aCenter jlcl_showRewardVideoAd];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
